﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UIFramework
{
    public enum ENUM_UITYPE
    {
        INVAILD = 0,
        LOGIN,              // login
        REGIST,             // regist
        GAMELOADING,        // GameLoading

    }

    public static class UIPathDefine
    {
        /* UI 预设 */
        public const string UI_CANVAS = "Prefabs/UICanvas";
        /* UI 预设 */
        public const string UI_PREFAB = "Prefabs/UI";
        /* UI 小控件预设 */
        public const string UI_CONTROLS_PREFAB = UI_PREFAB + "Control/";
        /* UI 子页面预设 */
        public const string UI_SUBUI_PREFAB = UI_PREFAB + "SubUI/";
        /* UI Icon预设*/
        public const string UI_ICON_PREFAB = UI_PREFAB + "Icon/";
    }


    public static class UITagDefine
    {
        /* UI Canvas Tag */
        public const string TAG_UI_CANVAS = "Tag_UICanvas";
    }


    public enum ENUM_UIEVENT_TYPE
    {
        INVAILD = 0,
        ONCLICK,
        ONDOUBLECLICK,
        ONDOWN,
        ONUP,
        ONENTER,
        ONEXIT,
        ONSELECT,
        ONUPDATESELECT,
        ONDESELECT,
        ONDRAG,
        ONDRAGEND,
        ONDROP,
        ONSCROLL,
        ONMOVE,
    }


    /// <summary>
    /// Define the UI context data
    /// 1. UI Type
    /// 2. UI Path
    /// 3. UI Params
    /// </summary>
    public class UIContext
    {
        public ENUM_UITYPE Type { get; private set; }
        public object[] Params { get; private set; }
        private GameObject gameObject;
        private string module;
        private string path;
        private string model;
        private string view;
        private string controller;

        public string Module
        {
            get
            {
                return module;
            }

            set
            {
                module = value;
            }
        }

        public string Path
        {
            get
            {
                return path;
            }

            set
            {
                path = value;
            }
        }

        public string Model
        {
            get
            {
                return model;
            }

            set
            {
                model = value;
            }
        }

        public string View
        {
            get
            {
                return view;
            }

            set
            {
                view = value;
            }
        }

        public string Controller
        {
            get
            {
                return controller;
            }

            set
            {
                controller = value;
            }
        }

        public GameObject GameObject
        {
            get
            {
                return gameObject;
            }

            set
            {
                gameObject = value;
            }
        }

        public UIContext(ENUM_UITYPE _uiType, params object[] _uiParams)
        {
            Type = _uiType;
            Params = _uiParams;
        }
    }
}

